import request from '@/config/axios'

// 防护装备 VO
export interface ProtectGearVO {
  id: number // id
  name: string // 类别名称
  type: number // 1个人2防护措施
  manufacturer: string // 生产厂家
  model: string // 型号
  parameter: string // 参数
}

// 防护装备 API
export const ProtectGearApi = {
  // 查询防护装备分页
  getProtectGearPage: async (params: any) => {
    return await request.get({ url: `/system/protect-gear/page`, params })
  },

  // 查询防护装备详情
  getProtectGear: async (id: number) => {
    return await request.get({ url: `/system/protect-gear/get?id=` + id })
  },

  // 新增防护装备
  createProtectGear: async (data: ProtectGearVO) => {
    return await request.post({ url: `/system/protect-gear/create`, data })
  },

  // 修改防护装备
  updateProtectGear: async (data: ProtectGearVO) => {
    return await request.put({ url: `/system/protect-gear/update`, data })
  },

  updateCreateTime: async (data: ProtectGearVO) => {
    return await request.put({ url: `/system/protect-gear/updateCreateTime`, data })
  },

  // 删除防护装备
  deleteProtectGear: async (id: number) => {
    return await request.delete({ url: `/system/protect-gear/delete?id=` + id })
  },

  // 导出防护装备 Excel
  exportProtectGear: async (params) => {
    return await request.download({ url: `/system/protect-gear/export-excel`, params })
  },
}
